package com.neutech.service.impl;
import com.neutech.mapper.MedicineMapper;
import com.neutech.service.MedicineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public  class MedicineServiceImpl implements MedicineService {
    @Autowired
    private MedicineMapper medicineMapper;
    @Override
    public List<Map<String, Object>> queryMedicine() {
        List<Map<String, Object>> list = medicineMapper.queryMedicineList(0);
        return list;
    }
    @Override
    public void insertMedicine(Map map){
        Integer a = medicineMapper.addMedicine(map);

    }
    public void updataMedicine(Map map){
        medicineMapper.updataMedicineById(map);
    }
    @Override
    public void deleteMedicine(Map map){
       // medicineMapper.delMedicineById(map);
//        System.out.println(map.get("MeID"));
//        System.out.println("kanzheli");
        Integer MeID= Integer.valueOf(map.get("MeID").toString());
        medicineMapper.delMedicineById(MeID);
    }
}
